﻿using System;

namespace IfStatement
{
    class Program
    {
        static void Main(string[] args)
        {
            // > < >= <= == !=
            /* 
             * 1 > 2 -> false
             * 1 < 2 -> true
             * 1 >= 2 -> false
             * 1 <= 2 -> true
             * 1 == 2 -> false
             * 1 != 2 -> true
             * "abc" == "abc" -> true
             * "abc" != "abc" -> false
             */

            if (true) // explicit true
            {
                Console.WriteLine("True"); // always executes
            }

            if (false) // explicit false
            {
                Console.WriteLine("False"); // nonsense
            }

            Console.Write("Age is: ");
            int age = int.Parse(Console.ReadLine());

            /*
            // version 1
            if (age >= 17)
            {
                Console.WriteLine("Allowed for exam.");
            }

            if (age < 17)
            {
                Console.WriteLine("Not allowed for exam.");
            }
            */

            /*
            // version 2
            if (age >= 17)
            {
                Console.WriteLine("Allowed for exam.");
            }
            else
            {
                Console.WriteLine("Not allowed for exam.");
            }
            */

            if (age <= 0)
            {
                Console.WriteLine("Error: age should be positive number.");
            }
            else
            {
                if (age > 120)
                {
                    Console.WriteLine("Error: Sorry, you are too old...");
                }
                else
                {
                    if (age >= 17)
                    {
                        Console.WriteLine("Allowed for exam.");
                    }
                    else
                    {
                        Console.WriteLine("Not allowed for exam.");
                    }
                }
            }


            //string s = "Yerevan";
            Console.WriteLine("Captital of Armenia is: ");
            //string key = Console.ReadLine();

            if (Console.ReadLine() == "Yerevan" /* key == s */)
            {
                Console.WriteLine("Pass");
            }
            else
            {
                Console.WriteLine("Fail");
            }

            Console.ReadKey();
        }
    }
}
